﻿using System.Data.Entity;

namespace EFCore7;

public class MyDbContext : DbContext
{
    private static string _connectionString = "server=127.0.0.1;uid=root;pwd=123456;port=3306;database=ldh;Allow User Variables=True;sslMode=None";

    //构造函数
    public MyDbContext() : this(_connectionString)
    {
        //Database.EnsureDeleted();
        // 如果数据库表不存在则创建
        //Database.Exists();
    }

    public MyDbContext(string conn) : base(_connectionString)
    {
    }
}